#ifndef LegoRenderer_h
#define LegoRenderer_h

#include <algorithm>

#include <Wt/WRectF>
#include <Wt/WPainter>
#include <Wt/WPaintedWidget>

#include <boost/shared_ptr.hpp>

namespace Wt
{
  class WContainerWidget;
}

struct _IplImage;
struct LegoSceneDescription;

#define DRAW_CIRCLES 0


class LegoRenderer : Wt::WPaintedWidget
{
public:
  LegoRenderer( Wt::WContainerWidget *parent = 0 );
  virtual ~LegoRenderer();

  void setScene( boost::shared_ptr<const LegoSceneDescription> );

  static void paintLegoScene( Wt::WPaintDevice *paintDevice,
                          boost::shared_ptr<const LegoSceneDescription> scene );
  static void paintLegoScene( _IplImage *img,
                          boost::shared_ptr<const LegoSceneDescription> scene );

protected:
  void paintEvent( Wt::WPaintDevice *paintDevice );

  boost::shared_ptr<const LegoSceneDescription> m_scene;
};//class LegoRenderer

#endif // LegoRenderer_h
